#ifndef ADAPTER_H
#define ADAPTER_H

#include "turkey.h"
#include "duck.h"

// 适配器
class Adapter : public Duck
{
public:
    Adapter(Turkey *turkey)
        : _turkey(turkey)
    {
    }

    virtual void Quack() = 0;
    virtual void Fly() = 0;
    // 抽象基类中API一定要声明为纯虚函数
    // virtual void Quack();
    // virtual void Fly();

protected:
    Turkey *_turkey;
};

class TurkeyAdapter : public Adapter
{
public:
    TurkeyAdapter(Turkey *turkey)
        : Adapter(turkey)
    {
    }

    void Quack();
    void Fly();
};

#endif